package atom.core3.spring.web.exception;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;

import atom.core0.exception.BizException;
  
@Controller  
public class GlobalController {  
  
      
    /** 
     * 用于处理异常的 
     * @return 
     */  
    @ExceptionHandler({BizException.class})  
    public String exception(BizException e) {  
        System.out.println(e.getMessage());  
        e.printStackTrace();  
        return "exception";  
    }  
      
    @RequestMapping("test")  
    public void test() throws BizException {  
        throw new BizException("出错了！");  
    }  
      
      
}  
